package cn.admin.remoting;

import cn.admin.remoting.impl.ConnectionResponse;
import org.apache.mina.common.WriteFuture;

public interface Client {

    int getRemotePort();

    String getConnectionUrl();

    String getAppName();

    String getClientKey();

    boolean isConnected();

    Connection getConnection();

    @Deprecated
    void destroy();

    void destroy(String cause);

    Object invokeWithSync(Object appRequest, RequestControl control) throws RemotingException,InterruptedException;

    @Deprecated
    Object invoke(Object appRequest) throws RemotingException,InterruptedException;

    @Deprecated
    Object invoke(Object appRequest, byte protocol) throws RemotingException,InterruptedException;

    @Deprecated
    Object invoke(Object appRequest, long timeoutMs) throws RemotingException,InterruptedException;

    ResponseFuture invokeWithFuture(Object appRequest, RequestControl control);

    @Deprecated
    ResponseFuture invokeWithFuture(Object appRequest);

    void invokeWithCallback(Object appRequest, ResponseCallback callback, RequestControl control);

    @Deprecated
    void invoke(Object appRequest, ResponseCallback callback);

    @Deprecated
    void invoke(Object appRequest, ResponseCallback callback, long timeoutMs);

    @Deprecated
    void oneway(Object appRequest);

    WriteFuture oneway(Object appRequest, RequestControl control);

    boolean putResponse(ConnectionResponse connectionResponse);

}
